package work;

import java.util.Date;

import model.duty;
import model.database;

public class DutyMethod {
	public static void addDuty(duty one)
	{
		database db = new database(
				"jdbc:mysql://localhost/gazi?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT&useSSL=false",
				"root",
				"123456");
		Date date = new Date();
		String timestamp = date.getTime() + "";
		String[] keys = {"cookie", "content", "isOpenMessageWarn", "warnTime", "timestamp"};
		String[] values = {
				one.getCookie(),
				one.getContent(),
				one.getIsOpenMessageWarn() + "",
				one.getWarnTime(),
				timestamp
		};
		db.insert("duty", keys, values);
	}
}
